<h1>Log Pembelian Serial</h1>
<h2>Serial yang belum anda gunakan</h2>
<div class="list">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th width="10">No.</th>
            <th>Tipe Serial</th>
            <th width="150">No. Serial</th>
            <th width="50">PIN</th>
        </tr>
        <?php
        if ($serial_unused != false) {
            $no = 1;
            foreach ($serial_unused as $row_unused) {
                $arr_serial_products_id = str_split($row_unused['serial_products_id'], 4);
                $serial_products_id = implode('-', $arr_serial_products_id);
                echo '<tr>';
                echo '<td align="right">' . $no . '.</td>';
                echo '<td>' . $row_unused['products_category_title'] . '</td>';
                echo '<td align="center">' . $serial_products_id . '</td>';
                echo '<td align="center">' . $row_unused['serial_products_pin'] . '</td>';
                echo '</tr>';
                $no++;
            }
        } else {
            echo '<tr><td colspan="4" align="center">-----====-----</td></tr>';
        }
        ?>
    </table>
</div>
<br />
<h2>Serial yang telah anda gunakan</h2>
<div class="list">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th width="10">No.</th>
            <th>Tipe Serial</th>
            <th width="150">No. Serial</th>
            <th width="50">PIN</th>
        </tr>
        <?php
        if ($serial_used != false) {
            $no = 1;
            foreach ($serial_used as $row_used) {
                $arr_serial_products_id = str_split($row_used['serial_products_id'], 4);
                $serial_products_id = implode('-', $arr_serial_products_id);
                echo '<tr>';
                echo '<td align="right">' . $no . '.</td>';
                echo '<td>' . $row_used['products_category_title'] . '</td>';
                echo '<td align="center">' . $serial_products_id . '</td>';
                echo '<td align="center">' . $row_used['serial_products_pin'] . '</td>';
                echo '</tr>';
                $no++;
            }
        } else {
            echo '<tr><td colspan="4" align="center">-----====-----</td></tr>';
        }
        ?>
    </table>
</div>
<?php if ($serial_request != false): ?>
    <br />
    <h2>Serial yang belum anda dapatkan</h2>
    <div class="list">
        <table cellpadding="0" cellspacing="0">
            <tr>
                <th width="10">No.</th>
                <th>Tipe Serial</th>
                <th width="150">No. Serial</th>
                <th width="50">PIN</th>
            </tr>
            <?php
            $no = 1;
            foreach ($serial_request as $row_request) {
                echo '<tr>';
                echo '<td align="right">' . $no . '.</td>';
                echo '<td>' . $row_request['products_category_title'] . '</td>';
                echo '<td align="center">' . $row_request['products_category_prefix'] . '-xxxx-xxxx-xxxx</td>';
                echo '<td align="center">xxxxxx</td>';
                echo '</tr>';
                $no++;
            }
            ?>
        </table>
    </div>
<?php endif; ?>